<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Sergey
 * Date: 08.08.13
 * Time: 12:37
 * To change this template use File | Settings | File Templates.
 */

define('BASE_PATH', realpath(dirname(__FILE__)));

ini_set("error_reporting", E_ALL & ~E_NOTICE);
ini_set("display_errors", 1);
ini_set("log_errors", 1);

mb_internal_encoding('UTF-8');
date_default_timezone_set('Europe/Kiev');

require_once BASE_PATH . '/vendor/autoload.php';

$app = new \Silex\Application();

$loader = new Twig_Loader_Filesystem(BASE_PATH . '/templates');
$app['twig'] = new Twig_Environment($loader, array(
    'cache'       => BASE_PATH . '/templates/cache',
    'auto_reload' => true
));

$app->get('/', 'Hockey\Controller\IndexController::index');
$app->get('/about', 'Hockey\Controller\IndexController::about');
$app->get('/gallery', 'Hockey\Controller\IndexController::gallery');
$app->get('/contacts', 'Hockey\Controller\IndexController::contacts');
$app->get('/checkout', 'Hockey\Controller\IndexController::checkout_get');
$app->post('/checkout', 'Hockey\Controller\IndexController::checkout_post');

$app->run();